//package com.zzh.partnersys.im.rocketmq.consumer;
//
//import com.zzh.partnersys.chat.message.response.ApplyAddFriendResponseMessage;
//import com.zzh.partnersys.rocketmq.contant.MQConstant;
//import com.zzh.partnersys.service.UserApplyService;
//import com.zzh.partnersys.service.UserFriendService;
//import org.apache.rocketmq.spring.annotation.MessageModel;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @author ??????
// * @version 1.0
// * ������Ӻ������������??
// */
//@RocketMQMessageListener(
//        topic = MQConstant.ADD_FRIEND_RES_TOPIC,
//        consumerGroup = MQConstant.CONSUMER_GROUP_ADD_FRIEND_APPLY_RES,
//        messageModel = MessageModel.BROADCASTING)
//@Component
//public class AddFriendApplyResMQConsumer implements RocketMQListener<ApplyAddFriendResponseMessage> {
//
//    @Autowired
//    private UserApplyService userApplyService;
//
//    @Autowired
//    private UserFriendService userFriendService;
//
//    @Override
//    public void onMessage(ApplyAddFriendResponseMessage addFriendResponseMessage) {
//        Long fromUid = addFriendResponseMessage.getFromUid();//3 �ظ�����
//        Long toUid = addFriendResponseMessage.getToUid();//1
//        String content = addFriendResponseMessage.getContent();
//        String fromName = addFriendResponseMessage.getFromName();
//        String toName = addFriendResponseMessage.getToName();
//
//
//        //user_apply??�޸ı���??
//        boolean isUpdate = userApplyService.updateApplyData(toUid,fromUid,content);
//        //�����б����
//        if ("ͬ��".equals(content)){
//            boolean isInsert = userFriendService.insertUserFriend(fromUid,toUid,fromName, toName);
//        }
//
//
//        if (!isUpdate){
//            //todo
//            System.out.println("ʧ��");
//        }
//
//    }
//
//
//}
